from flask_restful import Api

from app.api.search import Search
from app.api.about import AboutResource
from app.api.classes import ClassifyResource, Article_listsResource, Article_detailsResource
from app.api.collect import CollectResource
from app.api.collect_add import Collect_addResource
from app.api.collect_delete import Collect_deleteResource
from app.api.home import HomeResource
from app.api.login import LoginResource
from app.api.register import RegisterResource
from app.api.suggest import SuggestResource

api = Api()
api.add_resource(LoginResource, '/login/')
api.add_resource(RegisterResource, '/register/')
api.add_resource(SuggestResource, '/suggest/')
api.add_resource(AboutResource, '/about/')
api.add_resource(CollectResource, '/collect/')
api.add_resource(Collect_deleteResource, '/collect_delete/<int:p_id>/')
api.add_resource(Collect_addResource, '/collect_add/<int:p_id>/')
api.add_resource(HomeResource, '/home/')
api.add_resource(ClassifyResource, '/classify/')
api.add_resource(Article_listsResource, '/article_lists')
api.add_resource(Article_detailsResource, '/article_details')
api.add_resource(Search,'/search/')


def init_urls(app):
    api.init_app(app)
